package ar.com.sectorwine.controllers;

import java.util.Locale;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import ar.com.sectorwine.services.EmpresasService;

@Controller
@Transactional(propagation = Propagation.REQUIRES_NEW)
public class PublicacionesController {
	@Autowired
	private EmpresasService empresasService;

	@RequestMapping(value = "noticias_publicar", method = RequestMethod.POST)
	public ModelAndView publicar(Locale locale, Model model, @RequestParam String id) {
		ModelAndView mav = new ModelAndView("empresas/empresas_perfil");
		mav.addObject("empresa", empresasService.getEmpresa(id));
		return mav;
	}
}
